package cn.com.headfree.mouldshow.dao.impl;

import cn.com.headfree.entity.TAcadeAchiveInfo;
import cn.com.headfree.entity.TBusinessWorkflowBind;
import cn.com.headfree.mouldshow.dao.TAcadeAchiveInfoDao;
import cn.com.headfree.mouldshow.dao.TBusinessWorkflowBindDao;
import cn.com.headfree.vo.simple.AcadeAchiveInfoVo;
import com.gta.edu.sdk.base.dao.impl.BaseDaoImpl;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;

@Repository("/tBusinessWorkflowBindDao")
public class TBusinessWorkflowBindDaoImpl extends BaseDaoImpl<TBusinessWorkflowBind> implements TBusinessWorkflowBindDao {

    @Override
    public List<TBusinessWorkflowBind> getDealRoleIdByOrgIdAndBusinessTypeId(TBusinessWorkflowBind tBusinessWorkflowBind) throws Exception{
        String sql = "select t.id,t.org_id,t.business_type_id,t.deal_role_id ";
        StringBuilder sqlbuilder = new StringBuilder(sql);
        ArrayList<Object> arrayList = new ArrayList<Object>();
        sqlbuilder.append(" from t_business_workflow_bind t ");
        sqlbuilder.append(" where 1=1 ");
        sqlbuilder.append(" and t.org_id = ? ");
        sqlbuilder.append(" and t.business_type_id = ? ");
        arrayList.add(tBusinessWorkflowBind.getOrgId());
        arrayList.add(tBusinessWorkflowBind.getBusinessTypeId());
        return this.findAllBySQL(TBusinessWorkflowBind.class, sqlbuilder.toString(), null, false, arrayList.toArray());
    }
}
